package com.hnkywl.sts.entity.cggl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.cwgl.kmys.Cyfyys;
import com.hnkywl.sts.entity.organ.Qyjg;
import com.hnkywl.sts.entity.xsgl.Xsd;
import com.hnkywl.sts.entity.xsgl.Zkd;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-4-15
 * Time: 下午4:05
 * T_BIZ_GLFY新增字段：
 * type费用类型 type=1销售 type=2采购
 * sfzddh 是否直达到货类型  sfzddh=1 直达到货 sfzddh=0 非直达到货
 * yrk是否已入库  yrk=1已入库 yrk=0未入库
 * yck是否已出库  yck=1已出库 yck=0未出库
 *csh是否初始化  csh=1初始化csh=null未初始化
 */
@Entity
@Table(name = "T_BIZ_GLFY")
@Where(clause = "deleted!='1'")
public class Glfy extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqGlfy", allocationSize = 1, sequenceName = "SEQ_BIZ_GLFY")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqGlfy")
    private Long id;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CGD_ID")
    private Cgd cgd;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "XSD_ID")
    private Xsd xsd;
    // 转库单
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZKD_ID")
    private Zkd zkd;
    // 收益单位
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SYDW_ID")
    private Qyjg sydw;
    // 费用类别
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CYFY_FYLB_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Cyfyys fylb;
    // 计费数量
    private Double jfsl;
    // 单价
    private Double dj;
    // 金额
    private Double je;
    // 核定数量
    private Double hdsl;
    // 核定单价
    private Double hddj;
    // 核定金额
    private Double hdje;
    //可抵税额
    private Double kdse;
    //税额
    private Double se;
    //面额
    private Double me;
    //差额
    private Double ce;
    //净额
    private Double jsje;
    //状态 0-未结算 1-已结算
    private Integer zt = 0;
    // 备注
    private String bz;
    //物流结算单
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "WLJSD_ID")
    private Jsd wljsd;

    //物流单
    @OneToMany(fetch = FetchType.LAZY, targetEntity = Glfymx.class, mappedBy = "glfy")
    @NotFound(action = NotFoundAction.IGNORE)
    private List<Glfymx> glfymxList;

    //费用类型 type=1销售 type=2采购
    private Integer type;

    //是否直达到货类型  sfzddh=1 直达到货 sfzddh=0 非直达到货
    private  Boolean sfzddh;

    //yrk是否已入库  yrk=1已入库 yrk=0未入库
    //private  Boolean yrk;

    //yck是否已出库  yck=1已出库 yck=0未出库
    //private  Boolean yck;

    //初始化字段 csh=1表示初始化数据   csh=null表示非初始化数据
    private Integer csh;

    //关联单号
    private String gldh;

    /**
     * 操作状态
     */
    @Transient
    private String czzt;

    /**
     * 操作状态
     */
    @Transient
    private String cg_xs_dh;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Cgd getCgd() {
        return cgd;
    }

    public void setCgd(Cgd cgd) {
        this.cgd = cgd;
    }

    public Xsd getXsd() {
        return xsd;
    }

    public void setXsd(Xsd xsd) {
        this.xsd = xsd;
    }

    public Qyjg getSydw() {
        return sydw;
    }

    public void setSydw(Qyjg sydw) {
        this.sydw = sydw;
    }

    public Cyfyys getFylb() {
        return fylb;
    }

    public void setFylb(Cyfyys fylb) {
        this.fylb = fylb;
    }

    public Double getJfsl() {
        return jfsl;
    }

    public void setJfsl(Double jfsl) {
        this.jfsl = jfsl;
    }

    public Double getDj() {
        return dj;
    }

    public void setDj(Double dj) {
        this.dj = dj;
    }

    public Double getJe() {
        return je;
    }

    public void setJe(Double je) {
        this.je = je;
    }

    public Double getHdsl() {
        return hdsl;
    }

    public void setHdsl(Double hdsl) {
        this.hdsl = hdsl;
    }

    public Double getHddj() {
        return hddj;
    }

    public void setHddj(Double hddj) {
        this.hddj = hddj;
    }

    public Double getHdje() {
        return hdje;
    }

    public void setHdje(Double hdje) {
        this.hdje = hdje;
    }

    public Double getKdse() {
        return kdse;
    }

    public void setKdse(Double kdse) {
        this.kdse = kdse;
    }

    public Double getSe() {
        return se;
    }

    public void setSe(Double se) {
        this.se = se;
    }

    public Double getMe() {
        return me;
    }

    public void setMe(Double me) {
        this.me = me;
    }

    public Double getCe() {
        return ce;
    }

    public void setCe(Double ce) {
        this.ce = ce;
    }

    public Integer getZt() {
        return zt;
    }

    public void setZt(Integer zt) {
        this.zt = zt;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public Jsd getWljsd() {
        return wljsd;
    }

    public void setWljsd(Jsd wljsd) {
        this.wljsd = wljsd;
    }

    public List<Glfymx> getGlfymxList() {
        return glfymxList;
    }

    public void setGlfymxList(List<Glfymx> glfymxList) {
        this.glfymxList = glfymxList;
    }

    public Zkd getZkd() {
        return zkd;
    }

    public void setZkd(Zkd zkd) {
        this.zkd = zkd;
    }

    public Double getJsje() {
        return jsje;
    }

    public void setJsje(Double jsje) {
        this.jsje = jsje;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Boolean getSfzddh() {
        return sfzddh;
    }

    public void setSfzddh(Boolean sfzddh) {
        this.sfzddh = sfzddh;
    }

//    public Boolean getYrk() {
//        return yrk;
//    }
//
//    public void setYrk(Boolean yrk) {
//        this.yrk = yrk;
//    }
//
//    public Boolean getYck() {
//        return yck;
//    }
//
//    public void setYck(Boolean yck) {
//        this.yck = yck;
//    }

    public Integer getCsh() {
        return csh;
    }

    public void setCsh(Integer csh) {
        this.csh = csh;
    }

    public String getGldh() {
        return gldh;
    }

    public void setGldh(String gldh) {
        this.gldh = gldh;
    }

    public String getCzzt() {
        return czzt;
    }

    public void setCzzt(String czzt) {
        this.czzt = czzt;
    }

    public String getCg_xs_dh() {
        return cg_xs_dh;
    }

    public void setCg_xs_dh(String cg_xs_dh) {
        this.cg_xs_dh = cg_xs_dh;
    }
}
